package com.choosefine.base.common.bean

import com.fasterxml.jackson.core.JsonProcessingException
import com.fasterxml.jackson.databind.ObjectMapper
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.web.util.UriTemplateHandler

/**
 * Created by 邱鹏 on 2017/6/9.
 */
open class HttpBean() {
    @Autowired lateinit var jsonObjectMapper: ObjectMapper
    @Autowired lateinit var uriTemplateHandler:UriTemplateHandler

    @Throws(JsonProcessingException::class)
    fun json(returnResult: Any): String {
        return jsonObjectMapper.writeValueAsString(returnResult)
    }
}